package ch5;

import java.util.Scanner;

public class GetMax {

	public static void main(String[] args) {
		// 输入十个数，打印出最大值
		Scanner sca = new Scanner(System.in);
		int max = 0;
		int num = 0;

		for (int i = 1; i <= 10; i++) {
			System.out.print("请输入第" + i + "个数：");
			num = sca.nextInt();
			if (i == 1) {
				max = num;
			} else if (num > max) {
				max = num;
			}
		}
		System.out.println("\n最大的是" + max);
	}

}
